<template>
  <!-- 孔德嘉 商家名称 手机号 地址 2023年4月5日13点32分-->
  <!-- 商家信息 -->
  <div class="merchantInfo" style="width: 30%">
    <div style="width: 65%; display: inline-block; vertical-align: top">
      <!-- 名称 -->
      <p style="font-size: 16px; font-weight: 700; color: rgb(60, 60, 60)">
        {{ merchantInfo.name }}
      </p>

      <!-- 手机号 -->
      <p style="font-size: 12px; font-weight: 400; color: #868686">
        <i
          class="el-icon-phone-outline"
          style="margin-right: 4px; font-size: 18px"
        ></i
        >{{ merchantInfo.phone }}
      </p>
      <!-- 地址 -->
      <p style="font-size: 12px; font-weight: 400; color: #868686">
        <i
          class="el-icon-map-location"
          style="margin-right: 4px; font-size: 18px"
        ></i
        >{{ merchantInfo.address }}
      </p>
    </div>
    <!-- <button id="bottone5"
      style="
        width: 28%;
        display: inline-block;
        vertical-align: top;
        height: auto;
      "
    >
      <span
        style="
          font-size: 12px;
          display: inline-block;
        "
        ><i
          class="el-icon-chat-dot-round"
          style="margin-right: 10px; font-size: 14px"
        ></i
        >在线</span
      >
    </button> -->

    <!-- 地图 -->
    <div class="amap-wrapper">
      <el-amap
        ref="map"
        :vid="'amapDemo'"
        :center="merchantInfo.position"
        :zoom="zoom"
        :plugin="plugin"
        :events="events"
        class="amap-demo"
        style="height: 200px; width: 100%"
      >
        <!-- 地位地址 -->
        <el-amap-marker :position="merchantInfo.position"> </el-amap-marker>
      </el-amap>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 地图相关
      center: [116.12657, 40.23307],
      zoom: 16,
      events: {
        init(o) {
          // console.log(o.getCenter());
        },
        zoomchange: (e) => {
          // console.log(e);
        },
        zoomend: (e) => {
          //获取当前缩放zoom值
          // console.log(this.$refs.map.$$getInstance().getZoom());
          // console.log(e);
        },
        click: (e) => {
          alert("map clicked");
        },
      },
      markers: [
        {
          position: [116.12657, 40.23307],
        },
      ],
      //使用其他组件
      plugin: [
        {
          pName: "Scale",
          events: {
            init(instance) {
              // console.log(instance);
            },
          },
        },
        {
          pName: "ToolBar",
          events: {
            init(instance) {
              // console.log(instance);
            },
          },
        },
      ],
      // diy商家信息
      merchantInfo: {
        name: "absolutuniq手作馆",
        address: " 昌平区南口镇南大街21号 ",
        // 经纬度
        position: [116.12657, 40.23307],
        phone: "13520295039",
      },
    };
  },
};
</script>

<style scoped>
#bottone5 {
  align-items: center;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.25rem;
  box-shadow: rgba(0, 0, 0, 0.02) 0 1px 3px 0;
  box-sizing: border-box;
  color: rgba(0, 0, 0, 0.85);
  cursor: pointer;
  display: inline-flex;
  font-family: system-ui, -apple-system, system-ui, "Helvetica Neue", Helvetica,
    Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  justify-content: center;
  line-height: 1.25;
  min-height: 3rem;
  text-decoration: none;
  transition: all 250ms;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  vertical-align: baseline;
  width: auto;
}

#bottone5:hover,
#bottone5:focus {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: rgba(0, 0, 0, 0.1) 0 4px 12px;
  color: rgba(0, 0, 0, 0.65);
}

#bottone5:hover {
  transform: translateY(-1px);
}

#bottone5:active {
  background-color: #f0f0f1;
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: rgba(0, 0, 0, 0.06) 0 2px 4px;
  color: rgba(0, 0, 0, 0.65);
  transform: translateY(0);
}
</style>